<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('本单位人员管理')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row" id="index">

`        <!--登录信息-->
        <input name="userid" th:value="${session.userid}" type="hidden" id="userid">
        <input name="username" th:value="${session.username}" type="hidden" id="username">
        <input name="deptid" th:value="${session.deptid}" type="hidden" id="deptid">
        <input name="olddeptid" th:value="${session.olddeptid}" type="hidden" id="olddeptid">
        <input name="jigoujibie" th:value="${session.jigoujibie}" type="hidden" id="jigoujibie">
        <input name="roleid" th:value="${session.roleid}" type="hidden" id="roleid">`

        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>登录账号：</label>
                            <input type="text" v-model="loginName"/>
                        </li>
                        <li>
                            <label>电话：</label>
                            <input type="text" v-model="phonenumber"/>
                        </li>
                        <li>
                            <label>邮箱：</label>
                            <input type="text" v-model="email"/>
                        </li>
                        <li>
                            <a class="btn btn-success btn-rounded btn-md" @click="bindUserList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-md" @click="reset"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>



        <div class="col-sm-12 select-table table-striped">
            <div shiro:hasAnyRoles="zhongxin_superadmin,dept_superadmin" class="btn-group-md" id="toolbar" role="group" style="height: 50px;line-height: 50px;">
                <a  class="btn btn-primary btn-rounded btn-md" @click="toAdd()">
                    <i class="fa fa-plus"></i> 新增
                </a>
            </div>
            <table class="table table-hover table-primary table-striped">
                <thead>
                <tr>
                    <th style="text-align: center; vertical-align: middle;">登录账号</th>
                    <th style="text-align: center; vertical-align: middle;">用户名称</th>
                    <th style="text-align: center; vertical-align: middle;">手机</th>
                    <th style="text-align: center; vertical-align: middle;">邮箱</th>
                    <th style="text-align: center; vertical-align: middle;">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(userItem,index) in userlist"  v-if="userlist.length > 0">
                    <td style="vertical-align: middle; text-align: center;" v-text="userItem.loginName"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="userItem.userName"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="userItem.phonenumber"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="userItem.email"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="">
                        <button class="btn btn-success btn-rounded btn-md" @click="toChakan(userItem)">查看</button>
                        <button v-if="roleid==danweichaoguanroleid||roleid==zjzxroleid"
                                class="btn btn-warning btn-rounded btn-md" @click="toEdit(userItem)">修改</button>
                        <button v-if="roleid==danweichaoguanroleid||roleid==zjzxroleid"
                                class="btn btn-warning btn-rounded btn-md" @click="resetPwd(userItem)">修改密码</button>
                        <button v-if="roleid==danweichaoguanroleid||roleid==zjzxroleid"
                                class="btn btn-danger btn-rounded btn-md" @click="Remove(userItem.userId)">删除</button>
                    </td>
                </tr>
                <tr v-if="userlist.length == 0">
                    <td style="text-align: center; vertical-align: middle" colspan="5">查无数据</td>
                </tr>
                </tbody>
            </table>

        </div>

        <div th:replace="system/danweiguanli/bendanweirenyuanguanli/modal_add::add"></div>
        <div th:replace="system/danweiguanli/bendanweirenyuanguanli/modal_edit::edit"></div>
        <div th:replace="system/danweiguanli/bendanweirenyuanguanli/modal_chakan::chakan"></div>
    </div>
</div>

<th:block th:include="include :: footer" />
<script th:src="@{/js/system/danweiguanli/bendanweirenyuanguanli/index.js?v=1.1}"></script>
</body>
</html>
